#!/usr/bin/env python
# -*- coding:utf-8 -*-

# file:do_exam1.py
# author:王雯雯
# datetime:2024-11-12 
# software: PyCharm

def copy_txt_file(source_path, target_path):

    with open(source_path, "r") as source_file:

        content = source_file.read()

    with open(target_path, "w") as target_file:

        target_file.write(content)

source_file_path = "D:\source.txt"
target_file_path = "D:\ target.txt"

copy_txt_file(source_file_path, target_file_path)